﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PServiceBus.Core.Interface;
using PServiceBus.Core.Security;
using PServiceBus.Gateway.Interfaces.DTO;

namespace PServiceBus.Gateway.Interfaces {
    public interface IMessageBus : IDisposable {
        void CreateSubscriber(string subscriber, Dictionary<string, string> headers = null);
        void ChangeSubscriberDurability(string subscriber, bool durable, Dictionary<string, string> headers = null);
        void SubscribeTo(string subscriber, string topicName, string filter, bool needHeader, bool caseSensitive, Dictionary<string, string> headers = null);
        void UpdateSubscriber(string subscriber, string topicName, string filter, bool needHeader, bool caseSensitive, Dictionary<string, string> headers = null);
        void UnSubscribeFrom(string subscriber, string topicName, Dictionary<string, string> headers = null);
        void AddTransport(string subscriber, string transportName, ITransport transport, string topicName, Dictionary<string, string> headers = null);
        void DeleteTransport(string subscriber, string transportName, Dictionary<string, string> headers = null);
        SubscriberInfo SelectSubscriber(string name, Dictionary<string, string> headers = null);
        TopicInfo SelectTopic(string name, Dictionary<string, string> headers = null);
        void DeleteSubscriber(string name, Dictionary<string, string> headers = null);
        void RegisterTopic(TopicInfo topic, Dictionary<string, string> headers = null);
        void PublishTopic(TopicInfo topic, Dictionary<string, string> headers = null);
        void DeleteTopic(string name, Dictionary<string, string> headers = null);
        IList<TopicInfo> GetTopics(Dictionary<string, string> headers = null);
        bool IsClosed { get; }
        bool ReThrowException { get; set; }
        ESBIdentity Identity { get; set; }
        Dictionary<string, string> Headers { get; set; }
    }
}
